#ifndef SFX_KERNEL_INCLUDED
#define SFX_KERNEL_INCLUDED

// Adapted from https://github.com/keijiro/KinoBokeh/blob/master/Assets/Kino/Bokeh/Shader/DiskKernel.cginc

// rings = 2
// points per ring = 5
static const float2 kDiskKernel16[16] = {
    float2(0,0),
    float2(0.54545456,0),
    float2(0.16855472,0.5187581),
    float2(-0.44128203,0.3206101),
    float2(-0.44128197,-0.3206102),
    float2(0.1685548,-0.5187581),
    float2(1,0),
    float2(0.809017,0.58778524),
    float2(0.30901697,0.95105654),
    float2(-0.30901703,0.9510565),
    float2(-0.80901706,0.5877852),
    float2(-1,0),
    float2(-0.80901694,-0.58778536),
    float2(-0.30901664,-0.9510566),
    float2(0.30901712,-0.9510565),
    float2(0.80901694,-0.5877853)
};

// rings = 3
// points per ring = 7
static const float2 kDiskKernel22[22] = {
    float2(0,0),
    float2(0.53333336,0),
    float2(0.3325279,0.4169768),
    float2(-0.11867785,0.5199616),
    float2(-0.48051673,0.2314047),
    float2(-0.48051673,-0.23140468),
    float2(-0.11867763,-0.51996166),
    float2(0.33252785,-0.4169769),
    float2(1,0),
    float2(0.90096885,0.43388376),
    float2(0.6234898,0.7818315),
    float2(0.22252098,0.9749279),
    float2(-0.22252095,0.9749279),
    float2(-0.62349,0.7818314),
    float2(-0.90096885,0.43388382),
    float2(-1,0),
    float2(-0.90096885,-0.43388376),
    float2(-0.6234896,-0.7818316),
    float2(-0.22252055,-0.974928),
    float2(0.2225215,-0.9749278),
    float2(0.6234897,-0.7818316),
    float2(0.90096885,-0.43388376)
};

// rings = 4
// points per ring = 7
static const float2 kDiskKernel43[43] = {
    float2(0,0),
    float2(0.36363637,0),
    float2(0.22672357,0.28430238),
    float2(-0.08091671,0.35451925),
    float2(-0.32762504,0.15777594),
    float2(-0.32762504,-0.15777591),
    float2(-0.08091656,-0.35451928),
    float2(0.22672352,-0.2843024),
    float2(0.6818182,0),
    float2(0.614297,0.29582983),
    float2(0.42510667,0.5330669),
    float2(0.15171885,0.6647236),
    float2(-0.15171883,0.6647236),
    float2(-0.4251068,0.53306687),
    float2(-0.614297,0.29582986),
    float2(-0.6818182,0),
    float2(-0.614297,-0.29582983),
    float2(-0.42510656,-0.53306705),
    float2(-0.15171856,-0.66472363),
    float2(0.1517192,-0.6647235),
    float2(0.4251066,-0.53306705),
    float2(0.614297,-0.29582983),
    float2(1,0),
    float2(0.9555728,0.2947552),
    float2(0.82623875,0.5633201),
    float2(0.6234898,0.7818315),
    float2(0.36534098,0.93087375),
    float2(0.07473,0.9972038),
    float2(-0.22252095,0.9749279),
    float2(-0.50000006,0.8660254),
    float2(-0.73305196,0.6801727),
    float2(-0.90096885,0.43388382),
    float2(-0.98883086,0.14904208),
    float2(-0.9888308,-0.14904249),
    float2(-0.90096885,-0.43388376),
    float2(-0.73305184,-0.6801728),
    float2(-0.4999999,-0.86602545),
    float2(-0.222521,-0.9749279),
    float2(0.07473029,-0.99720377),
    float2(0.36534148,-0.9308736),
    float2(0.6234897,-0.7818316),
    float2(0.8262388,-0.56332),
    float2(0.9555729,-0.29475483)
};

// rings = 5
// points per ring = 7
static const float2 kDiskKernel71[71] = {
    float2(0,0),
    float2(0.2758621,0),
    float2(0.1719972,0.21567768),
    float2(-0.061385095,0.26894566),
    float2(-0.24854316,0.1196921),
    float2(-0.24854316,-0.11969208),
    float2(-0.061384983,-0.2689457),
    float2(0.17199717,-0.21567771),
    float2(0.51724136,0),
    float2(0.46601835,0.22442262),
    float2(0.32249472,0.40439558),
    float2(0.11509705,0.50427306),
    float2(-0.11509704,0.50427306),
    float2(-0.3224948,0.40439552),
    float2(-0.46601835,0.22442265),
    float2(-0.51724136,0),
    float2(-0.46601835,-0.22442262),
    float2(-0.32249463,-0.40439564),
    float2(-0.11509683,-0.5042731),
    float2(0.11509732,-0.504273),
    float2(0.32249466,-0.40439564),
    float2(0.46601835,-0.22442262),
    float2(0.7586207,0),
    float2(0.7249173,0.22360738),
    float2(0.6268018,0.4273463),
    float2(0.47299224,0.59311354),
    float2(0.27715522,0.7061801),
    float2(0.056691725,0.75649947),
    float2(-0.168809,0.7396005),
    float2(-0.3793104,0.65698475),
    float2(-0.55610836,0.51599306),
    float2(-0.6834936,0.32915324),
    float2(-0.7501475,0.113066405),
    float2(-0.7501475,-0.11306671),
    float2(-0.6834936,-0.32915318),
    float2(-0.5561083,-0.5159932),
    float2(-0.37931028,-0.6569848),
    float2(-0.16880904,-0.7396005),
    float2(0.056691945,-0.7564994),
    float2(0.2771556,-0.7061799),
    float2(0.47299215,-0.59311366),
    float2(0.62680185,-0.4273462),
    float2(0.72491735,-0.22360711),
    float2(1,0),
    float2(0.9749279,0.22252093),
    float2(0.90096885,0.43388376),
    float2(0.7818315,0.6234898),
    float2(0.6234898,0.7818315),
    float2(0.43388364,0.9009689),
    float2(0.22252098,0.9749279),
    float2(0,1),
    float2(-0.22252095,0.9749279),
    float2(-0.43388385,0.90096885),
    float2(-0.62349,0.7818314),
    float2(-0.7818317,0.62348956),
    float2(-0.90096885,0.43388382),
    float2(-0.9749279,0.22252093),
    float2(-1,0),
    float2(-0.9749279,-0.22252087),
    float2(-0.90096885,-0.43388376),
    float2(-0.7818314,-0.6234899),
    float2(-0.6234896,-0.7818316),
    float2(-0.43388346,-0.900969),
    float2(-0.22252055,-0.974928),
    float2(0,-1),
    float2(0.2225215,-0.9749278),
    float2(0.4338835,-0.90096897),
    float2(0.6234897,-0.7818316),
    float2(0.78183144,-0.62348986),
    float2(0.90096885,-0.43388376),
    float2(0.9749279,-0.22252086)
};


// rings = 6
// points per ring = 9
static const float2 kDiskKernel136[136] = {
    float2(0,0),
    float2(0.18181819,0),
    float2(0.13928081,0.116870485),
    float2(0.031572383,0.17905597),
    float2(-0.0909091,0.15745917),
    float2(-0.17085321,0.06218546),
    float2(-0.1708532,-0.062185526),
    float2(-0.09090908,-0.15745917),
    float2(0.03157248,-0.17905594),
    float2(0.13928084,-0.11687044),
    float2(0.34545454,0),
    float2(0.32462108,0.11815242),
    float2(0.26463354,0.22205392),
    float2(0.17272726,0.29917243),
    float2(0.059987526,0.34020633),
    float2(-0.059987593,0.3402063),
    float2(-0.17272729,0.2991724),
    float2(-0.2646336,0.22205384),
    float2(-0.3246211,0.118152365),
    float2(-0.34545454,-0.000000030200596),
    float2(-0.32462105,-0.1181525),
    float2(-0.26463348,-0.22205395),
    float2(-0.17272724,-0.29917243),
    float2(-0.059987538,-0.34020633),
    float2(0.059987705,-0.3402063),
    float2(0.17272724,-0.29917243),
    float2(0.2646336,-0.22205383),
    float2(0.3246211,-0.118152335),
    float2(0.5090909,0),
    float2(0.4953683,0.11740444),
    float2(0.45494026,0.22847958),
    float2(0.38998625,0.3272373),
    float2(0.304008,0.40835363),
    float2(0.20164058,0.46745548),
    float2(0.08840273,0.50135666),
    float2(-0.029601062,0.50822955),
    float2(-0.14600892,0.48770374),
    float2(-0.25454548,0.44088563),
    float2(-0.3493594,0.37029928),
    float2(-0.42533928,0.27974996),
    float2(-0.47838897,0.17411938),
    float2(-0.5056486,0.05910175),
    float2(-0.5056486,-0.059101958),
    float2(-0.47838897,-0.17411935),
    float2(-0.42533922,-0.27975005),
    float2(-0.34935933,-0.37029934),
    float2(-0.2545454,-0.44088566),
    float2(-0.14600895,-0.48770374),
    float2(-0.02960091,-0.5082296),
    float2(0.088402934,-0.5013566),
    float2(0.20164071,-0.46745542),
    float2(0.304008,-0.40835363),
    float2(0.3899862,-0.3272374),
    float2(0.4549403,-0.22847952),
    float2(0.49536833,-0.11740425),
    float2(0.6727273,0),
    float2(0.66250706,0.11681788),
    float2(0.63215685,0.2300863),
    float2(0.5825989,0.33636364),
    float2(0.515339,0.4324208),
    float2(0.43242073,0.515339),
    float2(0.3363636,0.5825989),
    float2(0.2300862,0.6321569),
    float2(0.11681782,0.66250706),
    float2(-0.000000029405843,0.6727273),
    float2(-0.11681795,0.66250706),
    float2(-0.23008636,0.63215685),
    float2(-0.33636367,0.5825989),
    float2(-0.4324208,0.515339),
    float2(-0.51533914,0.43242067),
    float2(-0.5825989,0.33636367),
    float2(-0.6321569,0.23008619),
    float2(-0.66250706,0.11681779),
    float2(-0.6727273,-0.000000058811686),
    float2(-0.66250706,-0.1168179),
    float2(-0.63215685,-0.23008645),
    float2(-0.5825988,-0.33636376),
    float2(-0.5153389,-0.43242085),
    float2(-0.4324207,-0.5153391),
    float2(-0.33636358,-0.5825989),
    float2(-0.23008624,-0.6321569),
    float2(-0.11681784,-0.66250706),
    float2(0.000000008022193,-0.6727273),
    float2(0.11681817,-0.662507),
    float2(0.23008625,-0.63215685),
    float2(0.33636358,-0.5825989),
    float2(0.4324207,-0.515339),
    float2(0.51533914,-0.4324206),
    float2(0.58259904,-0.3363635),
    float2(0.6321569,-0.23008613),
    float2(0.66250706,-0.11681773),
    float2(0.8363636,0),
    float2(0.8282242,0.11639932),
    float2(0.8039643,0.23053306),
    float2(0.76405615,0.34017974),
    float2(0.70927656,0.4432052),
    float2(0.6406917,0.5376042),
    float2(0.5596365,0.62153935),
    float2(0.46768853,0.6933769),
    float2(0.36663768,0.75171864),
    float2(0.25845054,0.7954291),
    float2(0.14523296,0.8236574),
    float2(0.029188568,0.8358541),
    float2(-0.08742384,0.8317819),
    float2(-0.20233473,0.81152004),
    float2(-0.31330743,0.7754628),
    float2(-0.41818187,0.7243121),
    float2(-0.51491684,0.6590635),
    float2(-0.60162973,0.5809869),
    float2(-0.6766324,0.49160215),
    float2(-0.7384652,0.39264894),
    float2(-0.78592473,0.2860531),
    float2(-0.8180871,0.17388971),
    float2(-0.83432627,0.058341574),
    float2(-0.83432627,-0.05834172),
    float2(-0.81808704,-0.17388986),
    float2(-0.78592473,-0.2860532),
    float2(-0.7384652,-0.39264905),
    float2(-0.67663234,-0.4916023),
    float2(-0.6016295,-0.58098716),
    float2(-0.5149169,-0.6590635),
    float2(-0.41818172,-0.7243122),
    float2(-0.3133071,-0.7754629),
    float2(-0.2023347,-0.81152004),
    float2(-0.0874237,-0.8317819),
    float2(0.02918891,-0.8358541),
    float2(0.1452334,-0.8236573),
    float2(0.2584507,-0.79542905),
    float2(0.36663792,-0.7517185),
    float2(0.4676886,-0.6933769),
    float2(0.5596366,-0.62153924),
    float2(0.6406918,-0.537604),
    float2(0.70927656,-0.4432052),
    float2(0.76405627,-0.3401796),
    float2(0.80396426,-0.23053318),
    float2(0.82822424,-0.11639891)
};



// // rings = 7
// // points per ring = 9
// static const float2 kDiskKernel190[190] = {
//     float2(0,0),
//     float2(0.15625,0),
//     float2(0.11969444,0.10043557),
//     float2(0.027132517,0.15387622),
//     float2(-0.07812501,0.13531646),
//     float2(-0.14682698,0.053440627),
//     float2(-0.14682697,-0.053440686),
//     float2(-0.078124985,-0.13531648),
//     float2(0.027132597,-0.1538762),
//     float2(0.11969447,-0.10043553),
//     float2(0.296875,0),
//     float2(0.27897125,0.101537235),
//     float2(0.22741944,0.19082758),
//     float2(0.14843749,0.2571013),
//     float2(0.05155178,0.2923648),
//     float2(-0.051551837,0.2923648),
//     float2(-0.14843751,0.2571013),
//     float2(-0.2274195,0.19082752),
//     float2(-0.27897125,0.10153719),
//     float2(-0.296875,-0.000000025953637),
//     float2(-0.27897123,-0.1015373),
//     float2(-0.2274194,-0.19082761),
//     float2(-0.14843747,-0.2571013),
//     float2(-0.05155179,-0.2923648),
//     float2(0.051551934,-0.29236478),
//     float2(0.14843747,-0.2571013),
//     float2(0.2274195,-0.1908275),
//     float2(0.27897125,-0.10153716),
//     float2(0.4375,0),
//     float2(0.42570713,0.10089444),
//     float2(0.39096427,0.19634965),
//     float2(0.33514443,0.28121957),
//     float2(0.2612569,0.3509289),
//     float2(0.17328487,0.40171954),
//     float2(0.0759711,0.43085337),
//     float2(-0.025438413,0.4367598),
//     float2(-0.12547642,0.4191204),
//     float2(-0.21875003,0.3788861),
//     float2(-0.30023074,0.31822595),
//     float2(-0.36552596,0.24041013),
//     float2(-0.41111553,0.14963384),
//     float2(-0.4345418,0.050790567),
//     float2(-0.43454176,-0.050790746),
//     float2(-0.41111553,-0.14963382),
//     float2(-0.3655259,-0.24041021),
//     float2(-0.30023068,-0.318226),
//     float2(-0.21874996,-0.37888613),
//     float2(-0.12547645,-0.4191204),
//     float2(-0.025438283,-0.43675983),
//     float2(0.075971276,-0.43085337),
//     float2(0.173285,-0.4017195),
//     float2(0.2612569,-0.3509289),
//     float2(0.3351444,-0.28121963),
//     float2(0.3909643,-0.19634959),
//     float2(0.42570716,-0.10089428),
//     float2(0.578125,0),
//     float2(0.56934196,0.10039036),
//     float2(0.5432598,0.1977304),
//     float2(0.5006709,0.2890625),
//     float2(0.44286945,0.3716116),
//     float2(0.37161157,0.44286948),
//     float2(0.28906247,0.50067097),
//     float2(0.19773033,0.5432598),
//     float2(0.10039031,0.569342),
//     float2(-0.000000025270646,0.578125),
//     float2(-0.10039042,0.56934196),
//     float2(-0.19773045,0.5432598),
//     float2(-0.28906253,0.5006709),
//     float2(-0.3716116,0.44286945),
//     float2(-0.44286954,0.3716115),
//     float2(-0.5006709,0.28906253),
//     float2(-0.5432598,0.19773032),
//     float2(-0.569342,0.100390285),
//     float2(-0.578125,-0.000000050541292),
//     float2(-0.56934196,-0.10039038),
//     float2(-0.54325974,-0.19773054),
//     float2(-0.50067085,-0.2890626),
//     float2(-0.44286937,-0.37161168),
//     float2(-0.37161154,-0.4428695),
//     float2(-0.28906244,-0.50067097),
//     float2(-0.19773035,-0.5432598),
//     float2(-0.10039033,-0.569342),
//     float2(0.0000000068940715,-0.578125),
//     float2(0.10039061,-0.56934196),
//     float2(0.19773036,-0.5432598),
//     float2(0.28906244,-0.50067097),
//     float2(0.37161154,-0.44286948),
//     float2(0.44286954,-0.37161148),
//     float2(0.500671,-0.28906235),
//     float2(0.5432598,-0.19773026),
//     float2(0.569342,-0.10039023),
//     float2(0.71875,0),
//     float2(0.71175516,0.10003067),
//     float2(0.6909068,0.19811435),
//     float2(0.6566108,0.29234195),
//     float2(0.60953456,0.38087946),
//     float2(0.55059445,0.46200362),
//     float2(0.4809376,0.5341354),
//     float2(0.40191984,0.5958708),
//     float2(0.31507927,0.64600825),
//     float2(0.22210595,0.6835719),
//     float2(0.12480958,0.7078306),
//     float2(0.025083927,0.71831214),
//     float2(-0.07512987,0.71481264),
//     float2(-0.17388143,0.69740003),
//     float2(-0.26924857,0.66641337),
//     float2(-0.35937503,0.6224558),
//     float2(-0.44250667,0.56638277),
//     float2(-0.51702553,0.49928564),
//     float2(-0.58148104,0.4224706),
//     float2(-0.6346186,0.33743268),
//     float2(-0.67540413,0.24582689),
//     float2(-0.7030436,0.14943647),
//     float2(-0.7169992,0.050137293),
//     float2(-0.7169992,-0.050137416),
//     float2(-0.7030436,-0.1494366),
//     float2(-0.6754041,-0.24582699),
//     float2(-0.6346185,-0.3374328),
//     float2(-0.5814809,-0.42247072),
//     float2(-0.51702535,-0.49928585),
//     float2(-0.4425067,-0.5663827),
//     float2(-0.35937494,-0.6224558),
//     float2(-0.2692483,-0.6664135),
//     float2(-0.17388138,-0.69740003),
//     float2(-0.07512974,-0.71481264),
//     float2(0.025084222,-0.71831214),
//     float2(0.12480995,-0.7078305),
//     float2(0.22210605,-0.6835718),
//     float2(0.31507945,-0.64600813),
//     float2(0.4019199,-0.5958708),
//     float2(0.48093772,-0.5341353),
//     float2(0.55059457,-0.46200344),
//     float2(0.60953456,-0.38087946),
//     float2(0.65661085,-0.29234186),
//     float2(0.6909068,-0.19811445),
//     float2(0.7117552,-0.10003032),
//     float2(0.859375,0),
//     float2(0.8535642,0.09976735),
//     float2(0.8362104,0.19818552),
//     float2(0.80754834,0.29392356),
//     float2(0.76796556,0.3856868),
//     float2(0.7179973,0.47223428),
//     float2(0.6583194,0.5523956),
//     float2(0.5897389,0.6250867),
//     float2(0.5131832,0.6893246),
//     float2(0.42968747,0.74424064),
//     float2(0.340381,0.78909194),
//     float2(0.2464715,0.8232722),
//     float2(0.14922895,0.84631914),
//     float2(0.04996813,0.8579211),
//     float2(-0.04996831,0.85792106),
//     float2(-0.14922892,0.84631914),
//     float2(-0.24647154,0.8232722),
//     float2(-0.3403811,0.78909194),
//     float2(-0.42968756,0.7442406),
//     float2(-0.5131831,0.6893247),
//     float2(-0.58973897,0.62508667),
//     float2(-0.6583196,0.55239546),
//     float2(-0.71799743,0.4722342),
//     float2(-0.76796556,0.38568678),
//     float2(-0.80754834,0.29392362),
//     float2(-0.8362104,0.19818547),
//     float2(-0.85356426,0.099767186),
//     float2(-0.859375,-0.00000007512895),
//     float2(-0.8535642,-0.099767536),
//     float2(-0.8362104,-0.19818541),
//     float2(-0.80754834,-0.29392356),
//     float2(-0.7679655,-0.3856869),
//     float2(-0.7179973,-0.47223434),
//     float2(-0.65831935,-0.5523957),
//     float2(-0.58973885,-0.6250868),
//     float2(-0.5131829,-0.68932486),
//     float2(-0.4296874,-0.74424064),
//     float2(-0.34038085,-0.78909206),
//     float2(-0.24647158,-0.8232722),
//     float2(-0.14922887,-0.8463192),
//     float2(-0.049968056,-0.8579211),
//     float2(0.049968075,-0.8579211),
//     float2(0.14922929,-0.8463191),
//     float2(0.24647161,-0.82327217),
//     float2(0.34038123,-0.7890919),
//     float2(0.4296878,-0.7442404),
//     float2(0.5131832,-0.6893246),
//     float2(0.589739,-0.62508667),
//     float2(0.65831935,-0.5523957),
//     float2(0.71799755,-0.47223398),
//     float2(0.7679656,-0.3856867),
//     float2(0.8075484,-0.29392338),
//     float2(0.8362105,-0.19818519),
//     float2(0.85356426,-0.09976731),
// };

#endif